﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using XZL.GM.Bll;
using XZL.GM.Dal;


public partial class Course_Reply : AdminBasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindReply();
        }
    }

     private void BindReply()
    {
        try { 
         string str = Request.QueryString["CommentID"];

         Proc_CommentInfo_SelectInfoResult comment = CommentInfo.GetCommentInfo(str);

         txtNickName.Text = comment.NickName.ToString();
         txtTime.Text =Convert.ToString(comment.CreateTime);
         txtCommentContent.Text = comment.CommentContent.ToString();
         txtReplyContent.Text = comment.ReplyContent;

        }
        catch { }
    }

    /// <summary>
    /// 回复
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
     protected void btnOK_Click(object sender, EventArgs e)
     {
         string replyContent = txtReplyContent.Text.Trim();
         if (replyContent.Length < 1)
         {
             lblWarn.Text = "至少回复1个字符！";
             txtReplyContent.Focus();
             return;
         }

        string commentID = Request.QueryString["CommentID"];
       
        string userID = Request.QueryString["UserID"];

        bool b = CommentInfo.ReplyMsg(commentID,replyContent);
         if(b)
         {
             lblWarn.Text = "回复成功！";
             lblWarn.ForeColor = System.Drawing.Color.Green;
             btnOK.Enabled = false;
         }
         else
         {
             lblWarn.Text = "回复失败！";
             lblWarn.ForeColor = System.Drawing.Color.Red;

         }
     }

}